<template>
	<view class="u-m-t-20">
		<view class="u-m-l-30 u-m-r-30 u-m-b-20 u-p-20 u-back-white u-radius-10 u-flex u-row-between"
			v-for="item in list" :key="item.userInfo.id" @click="goTeaPersonDetail(item.userInfo.id)">
			<view class="u-flex u-flex-1 u-ellipsis u-m-r-20">
				<u-image width="120rpx" height="120rpx" shape="circle"
					:src="item.userInfo.head_img"></u-image>
				<view class="u-m-l-20 u-ellipsis">
					<view class="u-flex">
						<view class="u-font-title u-ellipsis">{{item.userInfo.name}}</view>
						<view class="textTag u-back-oramage u-m-l-10" v-if="[0].includes(item.is_examine)">待审核</view>
						<view class="textTag u-back-blue u-m-l-10" v-if="[1].includes(item.is_examine) && [0].includes(item.is_sign)">已通过</view>
						<view class="textTag u-back-green u-m-l-10" v-else-if="[1].includes(item.is_examine) && [1].includes(item.is_sign)">已签到</view>
						<view class="textTag u-back-gray u-m-l-10" v-if="[2].includes(item.is_examine)">已拒绝</view>
					</view>
					<view class="u-m-t-10 u-color-puce u-font-desc">能量值：{{item.userInfo.number}}</view>
					<view class="u-m-t-10 u-color-gray u-font-desc u-ellipsis" v-if="item.reference_name">
						酒局邀请人：{{item.reference_name}}</view>
				</view>
			</view>
			<view class="u-flex" v-if="isPromoter">
				<view class="u-square-tag u-back-red u-m-r-20 u-p-l-50 u-p-r-50" v-if="[0].includes(item.is_examine)"
					@click.native.stop="examine(item.apply_id,item.userInfo.id)">审核</view>
				<view class="u-square-tag u-back-gray u-m-r-20 u-p-l-50 u-p-r-50"
					v-else-if="[1].includes(item.is_examine) && [0].includes(item.is_sign) && [0].includes(item.is_true)"
					@click.native.stop="refuse(item.apply_id,item.userInfo.id)">
					取消
				</view>
				<view class="u-square-tag u-back-red u-m-r-20 u-p-l-50 u-p-r-50"
					v-else-if="[1].includes(item.is_examine) && [0].includes(item.is_sign) && [1].includes(item.is_true)"
					@click.native.stop="process(item.apply_id,item.userInfo.id)">
					审核
				</view>
				<u-icon name="bodadianhua" custom-prefix="custom-icon" color="#F96257" size="60"
					@click.native.stop="callMobile(item.userInfo.phone)"></u-icon>
			</view>
			<view :class="item.is_president == 1 ? 'u-color-puce' : 'u-color-blue'"@click.native.stop="goTeaPersonDetail(item.userInfo.id)" v-else>{{ item.is_president == 1 ? '查看青创私董详情' : '查看来友详情' }} ></view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ["list", "isPromoter"],
		methods: {
			goTeaPersonDetail(val) {
				this.$emit("goTeaPersonDetail", val)
			},
			callMobile(val) {
				this.$emit("callMobile", val)
			},
			examine(apply, user) {
				const params = {
					apply_id: apply,
					user_id: user
				}
				this.$emit("examine", params)
			},
			refuse(apply, user) {
				const params = {
					apply_id: apply
				}
				this.$emit("refuse", params)
			},
			process(apply, user){
				const params = {
					apply_id: apply,
					user_id: user
				}
				this.$emit("process", params)
			}
		}
	}
</script>

<style scoped>
	.textTag {
		color: #fff;
		padding: 4rpx 12rpx;
		font-size: 22rpx;
		border-radius: 10rpx;
	}
</style>